package com.dfbz.springboot_project.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "admin_role", schema = "netctoss")
public class AdminRole {
    private Integer adminId;
    private Integer roleId;



    @Id
    @Column(name = "admin_id", nullable = false)
    public Integer getAdminId() {
        return adminId;
    }

    public void setAdminId(Integer adminId) {
        this.adminId = adminId;
    }



    @Id
    @Column(name = "role_id", nullable = false)
    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AdminRole adminRole = (AdminRole) o;
        return adminId == adminRole.adminId &&
                roleId == adminRole.roleId;
    }

    @Override
    public int hashCode() {
        return Objects.hash(adminId, roleId);
    }
}
